package itzzj.test.Iochar;

import java.io.*;

public class IoChar02 {
    public static void main(String[] args) throws IOException {
        String projectPath = System.getProperty("user.dir");
        File readerFile = new File(projectPath + "/描述.txt");
        File writerFile = new File(projectPath + "/line-" + readerFile.getName());
        // 缓冲字符输入输出流
        BufferedReader bufReader = new BufferedReader(new FileReader(readerFile));
        BufferedWriter bufWriter = new BufferedWriter(new FileWriter(writerFile));
        String line;
        // 字符读入和写出
        while ((line = bufReader.readLine()) != null){
            bufWriter.write(line);
            bufWriter.newLine();
        }
        bufWriter.flush();
        bufWriter.close();
        bufReader.close();
    }
}


























